\(\int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx\) [1282]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 34 \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\log (\sin (c+d x))}{a d}-\frac {\log (a+b \sin (c+d x))}{a d} \]

[Out]

ln(sin(d*x+c))/a/d-ln(a+b*sin(d*x+c))/a/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {2800, 36, 29, 31} \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\log (\sin (c+d x))}{a d}-\frac {\log (a+b \sin (c+d x))}{a d} \]

[In]

Int[Cot[c + d*x]/(a + b*Sin[c + d*x]),x]

[Out]

Log[Sin[c + d*x]]/(a*d) - Log[a + b*Sin[c + d*x]]/(a*d)

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \sin (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,b \sin (c+d x)\right )}{a d}-\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \sin (c+d x)\right )}{a d} \\ & = \frac {\log (\sin (c+d x))}{a d}-\frac {\log (a+b \sin (c+d x))}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00 \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\log (\sin (c+d x))}{a d}-\frac {\log (a+b \sin (c+d x))}{a d} \]

[In]

Integrate[Cot[c + d*x]/(a + b*Sin[c + d*x]),x]

[Out]

Log[Sin[c + d*x]]/(a*d) - Log[a + b*Sin[c + d*x]]/(a*d)

Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.59

method result size
derivativedivides \(-\frac {\ln \left (a \csc \left (d x +c \right )+b \right )}{d a}\) \(20\)
default \(-\frac {\ln \left (a \csc \left (d x +c \right )+b \right )}{d a}\) \(20\)
risch \(\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d a}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{a d}\) \(57\)

[In]

int(cos(d*x+c)*csc(d*x+c)/(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-1/d/a*ln(a*csc(d*x+c)+b)

Fricas [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.91 \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\log \left (b \sin \left (d x + c\right ) + a\right ) - \log \left (-\frac {1}{2} \, \sin \left (d x + c\right )\right )}{a d} \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

-(log(b*sin(d*x + c) + a) - log(-1/2*sin(d*x + c)))/(a*d)

Sympy [F]

\[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=\int \frac {\cos {\left (c + d x \right )} \csc {\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)/(a+b*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)*csc(c + d*x)/(a + b*sin(c + d*x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.97 \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\frac {\log \left (b \sin \left (d x + c\right ) + a\right )}{a} - \frac {\log \left (\sin \left (d x + c\right )\right )}{a}}{d} \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

-(log(b*sin(d*x + c) + a)/a - log(sin(d*x + c))/a)/d

Giac [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.03 \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\frac {\log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a} - \frac {\log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a}}{d} \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

-(log(abs(b*sin(d*x + c) + a))/a - log(abs(sin(d*x + c)))/a)/d

Mupad [B] (verification not implemented)

Time = 11.98 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.41 \[ \int \frac {\cot (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}{a\,d} \]

[In]

int(cos(c + d*x)/(sin(c + d*x)*(a + b*sin(c + d*x))),x)

[Out]

(log(tan(c/2 + (d*x)/2)) - log(a + 2*b*tan(c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^2))/(a*d)